class SYSTEM:
  QOS_MCREDIT_I = 10
  QOS_DCREDIT_I = 10

  QOS_MCREDIT_R = 0.4
  QOS_DCREDIT_R = 0.4
  
  FLIT_P_LINE = 8
  LINE_P_DMA = 8

  TIME = 0

  SLOWTIME =  9000
  STOPTIME = 10000
  
class LSTATE: # states for cache lines
  I  = 0 # invalid, avoid having this in data itself
  IP = 1 # invalid, request pending
  S  = 2 # readable
  SP = 3 # readable, writable request pending
  M  = 4 # writable

class MSTATE: # states for memory directory entry
  X = 0 # no one is using this at all, 
  S = 1 # nodes have this read cached
  E = 3 # a node has exclusive access
  I = 4 # caches with this line are being invalidated

class PCMD:
  NOP = 0

  # read shared, response assumed cached
  REQ_READ = 1
  REP_READ = 2
  # read exclusive, response assumed cached
  REQ_EXCL = 3
  REP_EXCL = 4

  REQ_DONE = 5

  REQ_INVL = 6
  ACK_INVL = 7
  
  # read uncached
  REQ_UREAD = 8
  REP_UREAD = 9
  
  # read uncached
  REQ_UWRITE = 10
  REP_UWRITE = 11

  # DMA: read memory lines
  DMA_READ = 12
  DMA_WRITE = 13

  DMA_DONE = 14 
  DMA_NACK = 15 # unimplemented

class PSIZE: # All these in flits
  REQ_READ = 2
  REP_READ = 2 # also must add payload length

  REQ_EXCL = 2
  REP_EXCL = 2 # may have payload

  REQ_DONE = 2

  REQ_INVL = 2
  ACK_INVL = 2 # may have a payload as well

  REQ_UREAD = 2
  REP_UREAD = 2

  REQ_UWRITE = 2 # has a payload
  REP_UWRITE = 2

  DMA_READ = 3
  DMA_WRITE = 3

  DMA_DONE = 2
  DMA_NACK = 2

class PRIO:
  NUM_LEVELS = 4

  DMA_READ  = 0
  DMA_WRITE = 0
  
  REQ_READ  = 1
  REQ_UREAD = 1
  REQ_UWRITE= 1
  REQ_EXCL  = 1
  
  REQ_INVL  = 2
  
  REP_READ  = 3
  REP_UREAD = 3
  REP_UWRITE= 3
  REP_EXCL  = 3
  
  ACK_INVL  = 3 

  REQ_DONE  = 3

  DMA_DONE = 3
  DMA_NACK = 3

class RCONSTS:
  MAX_PACKETS = 8
  MAX_FLITS = 2
  OUT_BW = 10

class CCONSTS:
  MAX_REQUESTS = 8
  MAX_PACKETS = 4
  NUM_LINES = 8

class DCONSTS:
  MAX_REQUESTS = 8
  MAX_PACKETS = 4

class MCONSTS:
  MAX_REQUESTS = 8
  MAX_PACKETS = 4
  NUM_LINES = 64

class BINAGENT:
  MAX_PACKETS = 4
  OUT_BW = 10
  IN_BW = 10

class MAGIC:
  MAX_PSIZE = 1000
